#include <GLES3/gl3.h>
#include <GLES3/gl32.h>

#define UP_DIV(x, y) (((x) + (y) - (1)) / (y))
#define ROUND_UP(x, y) (((x) + (y) - (1)) / (y) * (y))

#define GL_CHECK_ERROR() \
{\
    GLenum err = glGetError(); \
    if (err != GL_NO_ERROR) \
    {\
        printf("[%s:%d] glGetError returns %d\n", __FUNCTION__, __LINE__, err); \
    }\
}

GLuint GLMalloc(int width, int height, int channel);

GLuint CreateComputeProgram(const char* pComputeSource);

void GLCopyHostToDevice(float *input, GLuint textureId, int width, int height, int channel);

void GLCopyDeviceToHost(GLuint textureId, float *output, int width, int height, int channel);

